package com.fr.base.core.image4j.codec.bmp;

import java.awt.image.BufferedImage;

public class BMPImage
{
  protected InfoHeader infoHeader;
  protected BufferedImage image;

  public BMPImage(BufferedImage paramBufferedImage, InfoHeader paramInfoHeader)
  {
    this.image = paramBufferedImage;
    this.infoHeader = paramInfoHeader;
  }

  public InfoHeader getInfoHeader()
  {
    return this.infoHeader;
  }

  public void setInfoHeader(InfoHeader paramInfoHeader)
  {
    this.infoHeader = paramInfoHeader;
  }

  public BufferedImage getImage()
  {
    return this.image;
  }

  public void setImage(BufferedImage paramBufferedImage)
  {
    this.image = paramBufferedImage;
  }

  public int getWidth()
  {
    return ((this.infoHeader == null) ? -1 : this.infoHeader.iWidth);
  }

  public int getHeight()
  {
    return ((this.infoHeader == null) ? -1 : this.infoHeader.iHeight);
  }

  public int getColourDepth()
  {
    return ((this.infoHeader == null) ? -1 : this.infoHeader.sBitCount);
  }

  public int getColourCount()
  {
    int i = (this.infoHeader.sBitCount == 32) ? 24 : this.infoHeader.sBitCount;
    return ((i == -1) ? -1 : 1 << i);
  }

  public boolean isIndexed()
  {
    return (this.infoHeader != null);
  }
}